# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: team/kde <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-other
pkgname=rkward
pkgver=0.8.0
pkgrel=0
pkgdesc="Easy extensible and easy-to-use IDE/GUI for R"
# armhf blocked by extra-cmake-modules
# s390x, ppc64le, riscv64 and loongarch64 blocked by qt6-qtwebengine
arch="all !armhf !s390x !ppc64le !riscv64 !loongarch64"
url="https://rkward.kde.org/"
license="GPL-2.0-or-later"
depends="R"
makedepends="
	R-dev
	extra-cmake-modules
	kconfig-dev
	kcoreaddons-dev
	kdoctools-dev
	ki18n-dev
	knotifications-dev
	kparts-dev
	ktexteditor-dev
	kwidgetsaddons-dev
	kwindowsystem-dev
	kxmlgui-dev
	qt6-qtbase-dev
	qt6-qtwebengine-dev
	samurai
	"
checkdepends="xvfb-run"
_repo_url="https://invent.kde.org/education/rkward.git"
source="https://download.kde.org/stable/rkward/$pkgver/rkward-$pkgver.tar.gz"
subpackages="$pkgname-doc $pkgname-lang"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

check() {
	xvfb-run ctest --test-dir build --output-on-failure
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
07070189e05fe1bdd65372fb3f90c027c693b93e3dc80a17bc30f90c983ca0bc777f30ea81ef99343ebdc90f463f47721d03f26d116145567c8ef6ca4ffdff27  rkward-0.8.0.tar.gz
"
